<%@page pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SearchData</title>
</head>
<body>

<a href="${f:url('create')}">Create</a>
<a href="${f:url('refresh')}">Refresh</a>
<table>
	<c:forEach var="e" items="${list}">
		<tr>
			<td>${f:h(e.query)}</td>
			<td>${f:h(e.engineName)}</td>
			<td><fmt:formatDate value="${e.refreshDate}" pattern="yyyy/MM/dd HH:mm:ss" /></td>
			
			<c:set var="showUrl" value="show/${f:h(e.key)}/${e.version}" />
			<c:set var="diffUrl" value="show?key=${f:h(e.key)}&type=diff" />
			<c:set var="editUrl" value="edit/${f:h(e.key)}/${e.version}" />
			<c:set var="deleteUrl" value="delete/${f:h(e.key)}/${e.version}" />
			
			<td>${e.newFlag ? "new" : ""}</td>
			<td><a href="${e.webPage}" target="_blank">Web</a></td>
			<td><a href="${f:url(showUrl)}">Show</a></td>
			<td><a href="${f:url(diffUrl)}">Diff</a></td>
			<td><a href="${f:url(editUrl)}">Edit</a></td>
			<td><a href="${f:url(deleteUrl)}" onclick="return confirm('delete OK?')">Delete</a>
			</td>
		</tr>
	</c:forEach>
</table>
</body>
</html>
